<?php
if(isset($_POST['username']) && isset($_POST['password'])):
    require 'BL/users.php';
    $blo= new Users();
    if($blo->userLogin($_POST['username'], $_POST['password'])):
        
        header("location:".$config['site_url']);
        
    else:
?>
    <div id="login-failed">
        <h3>Might Have enter wrong user name or password!!</h3>
    </div>
<?php
    endif;

else:
?>

<div id="login">
    <pre>
            <form action="/login" method="POST">
                <span>User Name:</span> <input type="text" size="20" name="username">
                <span>Password:</span>  <input type="password" name="password" size="20">
                <input type="submit" value="Login">
            </form>
    </pre>
</div>
<?php endif; ?>